<?php 

setcookie('identifier', $_REQUEST['identifier'],time() + (86400 * 70),'/');
$link = mysql_connect('localhost', 'root', '');
if(!$link)
{
	die('Not connected : ' . mysql_error());
}
$db = mysql_select_db('games');
if(!$db)
{
	die('No db : ' . mysql_error());
}

$query = "SELECT * FROM users where Identifier = '".$_REQUEST['identifier']."'";

$result = mysql_query($query);
if(!$result)
{
	die('Query error : ' . mysql_error());
}
if(mysql_num_rows($result) == 0)
{
	ob_start();
	 echo '<form name="submitident" method="post" action="create-user.php">
      			<input type="hidden" value="'.$_REQUEST['identifier'].'" name="identifier">
      			<input type="hidden" value="'.$_REQUEST['firstname'].'" name="firstname">
      			<input type="hidden" value="'.$_REQUEST['lastname'].'"name="lastname">
      			<input type="hidden" value="'.$_REQUEST['email'].'"name="email">
      		</form>
      		<script>document.submitident.submit();</script>'; 
      		//echo $_REQUEST['firstname'];
      		//echo $_REQUEST['lastname'];
      		//echo $_REQUEST['email'];
      		//echo $_REQUEST['identifier'];
}
else
{
	ob_start();
	header( 'Location: profile.php');
	//echo mysql_num_rows($result);
}



?>